#include <bits/stdc++.h>
// 2025/06/09
// tag: 
// Author: Forever
using namespace std;
using int64 = int64_t;

const int N = 1501;
int n, f[N][2];
vector<int> edge[N];

void dfs(int u, int fa){
    f[u][1] = 1;
    for (int v : edge[u]){
        if (v == fa) continue;
        dfs(v, u);
        f[u][0] += f[v][1];
        f[u][1] += min(f[v][0], f[v][1]);
    }
}

signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin >> n;
    for (int i = 1; i <= n; i++){
        int k, v;
        cin >> k >> k;
        for (int j = 1; j <= k; j++){
            cin >> v;
            edge[i].push_back(v + 1);
            edge[v + 1].push_back(i);
        }
    }
    dfs(1, 0);
    cout << min(f[1][0], f[1][1]) << endl;
    return 0;
}